<?php
session_start();

include "webmaster_connect.php";

$page_permission = 2;

include "webmaster_check_login.php";
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>

<style type="text/css">
body {
	background-image: url(../images/wood.jpg);
	background-repeat: repeat-x;
	margin: 0px;
	background-position: left top;
	background-attachment: fixed;
	background-color: #000000;
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
}
</style>
<link href="../css/webmaster_edit_products.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="page_container">

<?php 

include "../admin_files/webmaster_header.php";
include "../admin_files/webmaster_navigation.php" 

?>

<div id="content_container">


<h1>Sales Report:</h1>

<table width="970px" border="0" cellpadding="3">

<tr>
    <th class="header" scope="col">Payment id</th>
    <th class="header" scope="col">Payment</th>
    <th class="header" scope="col">Shipping</th>
    <th class="header" scope="col">Payment date</th>
    <th class="header" scope="col">Source</th>
    <th class="header" scope="col">Payer name</th>
    <th class="header" scope="col">Payment status</th>
    <th class="header" scope="col">Product id</th>
    <th class="header" scope="col">Product name</th>
    <th class="header" scope="col">Product cost</th>
    <th class="header" scope="col">Product status</th>
  </tr>

<?php 

$query = "SELECT *
		  FROM paypal_payments
		  INNER JOIN saddles
		  ON paypal_payments.product_id = saddles.product_id";

$result = mysql_query($query);
while($row = mysql_fetch_array($result))
{
	
echo '

  <tr id="'.$row['payment_id'].'">
  
	<th>'.$row['payment_id'].'</th>
	<th>£'.$row['payment'].'</th>
	<th>£'.$row['shipping'].'</th>
	<th>'.$row['payment_date'].'</th>
	<th>'.$row['source'].'</th>
	<th>'.$row['firstname'].' '.$row['lastname'].'</th>
	<th>'.$row['payment_status'].'</th>
	<th>'.$row['product_id'].'</th>
	<th>'.$row['product_name'].'</th>
	<th>£'.$row['product_cost'].'</th>
	<th>'.$row['product_status'].'</th>
	
  </tr>

';
	
}

?>

</table>

<?php  //echo $query ?>

</div>
<!--login_container-->

</div> 
<!--page_container-->

</body>
</html>

